package com.he.feign;

import com.he.entity.Hotel;
import com.he.entity.ResultData;
import com.he.entity.Room;
import com.he.entity.RoomPrice;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("micro-hotel")
public interface HotelFeign {


    @RequestMapping("/hotel/list")
    ResultData<List<Hotel>> hotelList();

    @RequestMapping("/hotel/save")
    ResultData<Boolean> saveHotel(@RequestBody Hotel hotel);

    @RequestMapping("/hotel/getHotelByHid/{hid}")
    Hotel getHotelByHid(@PathVariable Integer hid);

    @RequestMapping("/hotel/getHotelNameByHid/{hid}")
    String getHotelNameByHid(@PathVariable Integer hid);

    @RequestMapping("/room/getRoomByHid/{hid}")
    ResultData<List<Room>> getRoomByHid(@PathVariable Integer hid);

    @RequestMapping("/room/saveRoom")
    ResultData<Boolean> saveRoom(@RequestBody Room room);

    @RequestMapping("/room/updateBNum/{hid}/{num}")
    void updateBNum(@PathVariable("hid") Integer bid,@PathVariable("num") Integer num);

    @RequestMapping("/room/getPrice")
    ResultData<List<RoomPrice>> getRoomPrice(@RequestParam Integer rid);

    @RequestMapping("/room/updateprice")
    ResultData<Boolean> updatePrice(@RequestBody RoomPrice roomPrice);

    @RequestMapping("/room/getHotelId/{rid}")
    ResultData<Integer> getHotelIdByRoomId(@PathVariable Integer rid);

    @RequestMapping("/room/getRoom/{rid}")
    ResultData<Room> getRoomById(@PathVariable Integer rid);
}
